/*     */ package com.newcrm.businessarchives;
/*     */ 
/*     */ import com.newcrm.db.CompanyBusinessArchiveManager;
/*     */ import com.newcrm.exception.CaptchaException;
/*     */ import java.util.Map;
/*     */ 
/*     */ public abstract class SearchEngine
/*     */ {
/*     */   public static final String CompanyName = "CompanyName";
/*     */   public static final String GSUrl = "GSUrl";
/*     */   public static final String Address = "Address";
/*     */   public static final String SN = "SN";
/*     */   public static final String CompanyType = "CompanyType";
/*     */   public static final String Header = "Header";
/*     */   public static final String Divisions = "Divisions";
/*     */   public static final String FoundedDate = "FoundedDate";
/*     */   public static final String RegisteredCapital = "RegisteredCapital";
/*     */   public static final String OperatingPeriod = "OperatingPeriod";
/*     */   public static final String OperatingPeriodStart = "OperatingPeriodStart";
/*     */   public static final String OperatingPeriodEnd = "OperatingPeriodEnd";
/*     */   public static final String RegistrationAuthority = "RegistrationAuthority";
/*     */   public static final String BusinessScope = "BusinessScope";
/*     */   public static final String BusinessScope2 = "BusinessScope2";
/*     */   public static final String AnnualinSpectionYear = "AnnualinSpectionYear";
/*     */   public static final String AnnualinSpectionResult = "AnnualinSpectionResult";
/*     */   public static final String UpdateDate = "UpdateDate";
/*     */   public static final String SEARCH_URL_BEIJING = "http://qyxy.baic.gov.cn/lucene/luceneAction!NetCreditLucene.dhtml?idFlag=qyxy&queryStr=";
/*     */   public static final String SEARCH_URL_SHANGHAI = "http://www.sgs.gov.cn/lz/etpsInfo.do?method=doSearch";
/*     */   public static final String SEARCH_URL_WUHAN = "http://gssoso.whhd.gov.cn:8086/soso/search";
/*     */   public static final String SEARCH_URL_HANGZHOU = "http://www.92777.com/qiye/qiye_search_view.asp?qymc=";
/*     */   public static final String SEARCH_URL_GUANGDONG = "http://wsnj.gdgs.gov.cn/aiccps/SearchServlet?service=getEntityInfoByPage&corpName=";
/*     */   public static final String SEARCH_URL_NEWGUANGDONG = "http://gsxt.gdgs.gov.cn/CheckEntContext/showInfo.html?textfield=";
/*     */   public static final String SEARCH_URL_JIANGXI = "http://218.65.88.119:8899/getEnterprisesByCodition.action?item_code=&lawperson=&companyname=";
/*     */   public static final String SEARCH_URL_HUNAN = "http://www.hnaic.gov.cn/visit/socialservice/a/listEnterpriseForAjax?nocache=1373953906130&keyselect=null&marktype=1&page=1&key=";
/*     */   public static final String SEARCH_URL_HUNAN_DETAIL = "http://www.hnaic.gov.cn/visit/socialservice/a/listEntSingleForAjax?nocache=1373954782518&markid=";
/*     */   public static final String SEARCH_URL_GUANGXI = "http://116.252.222.40:8888/enterpriseinfo.jspx?shotName=";
/*     */   public static final String SEARCH_URL_ANHUI = "http://218.22.14.69:8085/topbirt/run?zch=&fddbr=&__balance_unit=%25E5%2585%2583&__report=%2Fqycx.rptdesign&__page=-1&__actionFlag=getResultFrame&__pageButtonFlag=&__exportFileType=&__exportPageNos=&__exportCSVTableName=&__exportCSVColumns=&__exportCSVEncoding=&__exportCSVSeperator=&__printPageType=&__printPageNos=&__extJsGridCookie=&__mainReportQuery=true&__screenWidth=1440&qymc=";
/*     */   public static final String SEARCH_URL_ANHUI2 = "http://www.hdfw.net.cn/srch.jsp?select=mc&ipt=";
/*     */   public static final String SEARCH_URL_HENAN = "http://www.haaic.gov.cn/search/?db=entmaininfo&page=1&pagesize=20&variable=v1&rnd=0.42803900805301964&_=1381461089964&keyword=entname:";
/*     */   public static final String SEARCH_URL_ZHEJIANG = "http://wcm.zjaic.gov.cn/zjaic/wsbs/zxcx/qyjbxxcx/query!getCropInfoList.action?name=";
/*     */   public static final String SEARCH_URL_JINAN = "http://www.jngsj.gov.cn/search/any_DETAIL.asp?qymc=";
/*     */   public static final String SEARCH_URL_HEBEI = "http://222.223.188.7/wsgs/ywztcx/list.asp?entName=";
/*     */   public static final String SEARCH_URL_KUNMING = "http://www.kmaic.gov.cn/KmaicOut/website/TbResult.aspx?zch=&gt=&qymc=";
/*     */   public static final String SEARCH_URL_JIANGSU = "http://www.jsgsj.gov.cn/baweb/show/sj/business_query.jsp?flag=2&fenceid=1&businessName=";
/*     */   public static final String SEARCH_URL_NANTONG = "http://www.ntgsj.gov.cn/baweb/show/shiju/business_query.jsp?flag=2&fenceid=1&businessName=";
/*     */   public static final String SEARCH_URL_WUXI = "http://www.wxgsj.gov.cn/baweb/show/shiju/business_query.jsp?flag=2&fenceid=1&businessName=";
/*     */   public static final String SEARCH_URL_XUZHOU = "http://www.xzgsj.gov.cn/baweb/show/shiju/business_query.jsp?flag=2&fenceid=1&businessName=";
/*     */   public static final String SEARCH_URL_CHANGZHOU = "http://www.czgsj.gov.cn/baweb/show/shiju/business_query.jsp?flag=2&fenceid=1&businessName=";
/*     */   public static final String SEARCH_URL_SUZHOU = "http://www.szsgsj.gov.cn/suzhoubaweb/show/sj/business_query.jsp?flag=2&fenceid=1&businessName=";
/*     */   public static final String SEARCH_URL_LIANYUNGANG = "http://www.lyggsj.gov.cn/baweb/show/shiju/business_query.jsp?flag=2&fenceid=1&businessName=";
/*     */   public static final String SEARCH_URL_YANGZHOU = "http://www.yzgsj.gov.cn/baweb/show/shiju/business_query.jsp?flag=2&fenceid=1&businessName=";
/*     */   public static final String SEARCH_URL_ZHENJIANG = "http://www.zjgsj.gov.cn/baweb/show/shiju/business_query.jsp?flag=2&fenceid=1&businessName=";
/*     */   public static final String SEARCH_URL_TAIZHOU = "http://www.tzgsj.gov.cn/baweb/show/shiju/business_query.jsp?flag=2&fenceid=1&businessName=";
/*     */   public static final String SEARCH_URL_SUQIAN = "http://www.sqgsj.gov.cn/baweb/show/shiju/business_query.jsp?flag=2&fenceid=1&businessName=";
/*     */   public static final String SEARCH_URL_YANCHENG = "http://www.ycgsj.gov.cn/baweb/show/shiju/business_query.jsp?flag=2&fenceid=1&businessName=";
/*     */   public static final String SEARCH_URL_NANJING = "http://www.njgs.gov.cn/CorpQuery";
/*     */   public static final String USER_AGENT = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB6.6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0; .NET CLR 1.1.4322; .NET4.0C)";
/*     */   public static final String COMPANY_PERSON = "个体经营";
/*     */   public static final String COMPANY_AREA = "上海,北京,湖北,武汉,广东,深圳,广州,杭州,珠海,汕头,佛山,韶关,河源,梅州,惠州,汕尾,东莞,中山,江门,阳江,湛江,茂名,肇庆,清远,潮州,揭阳,云浮,南昌,九江,景德镇,萍乡,新余,鹰潭,赣州,宜春,上饶,吉安,抚州,江西,长沙,株洲,湘潭,衡阳,邵阳,岳阳,常德,张家界,益阳,郴州,永州,怀化,娄底,湘西,湖南,广西,南宁,桂林,北海,柳州,梧州,玉林,百色,崇左,贵港,河池,贺州,来宾,防城港,钦州,安徽,合肥,淮北,亳州,宿州,蚌埠,阜阳,淮南,滁州,六安,马鞍山,芜湖,宣城,铜陵,池州,安庆,黄山,河南,郑州,开封,洛阳,平顶山,新乡,安阳,焦作,鹤壁,濮阳,三门峡,许昌,漯河,南阳,商丘,信阳,周口,驻马店,济源,浙江,宁波,金华,温州,台州,丽水,绍兴,衡州,舟山,嘉兴,湖州,温岭,济南,河北,石家庄,保定,唐山,邯郸,张家口,承德,邢台,秦皇岛,廊坊,沧州,衡水,昆明,江苏,南京,无锡,徐州,常州,苏州,南通,连云港,淮安,盐城,扬州,镇江,泰州,宿迁";
/*     */   public static final String COMPANY_SHANGHAI = "上海";
/*     */   public static final String COMPANY_BEIJING = "北京";
/*     */   public static final String COMPANY_HUBEI = "湖北";
/*     */   public static final String COMPANY_WUHAN = "武汉";
/*     */   public static final String COMPANY_GUANGZHOU = "广州";
/*     */   public static final String COMPANY_SHENZHEN = "深圳";
/*     */   public static final String COMPANY_HANGZHOU = "杭州";
/*     */   public static final String COMPANY_JINAN = "济南";
/*     */   public static final String COMPANY_KUNMING = "昆明";
/*     */   public static final String COMPANY_NANTONG = "南通";
/*     */   public static final String COMPANY_NANJING = "南京";
/*     */   public static final String COMPANY_WUXI = "无锡";
/*     */   public static final String COMPANY_XUZHOU = "徐州";
/*     */   public static final String COMPANY_CHANGZHOU = "常州";
/*     */   public static final String COMPANY_SUZHOU = "苏州";
/*     */   public static final String COMPANY_LIANYUNGANG = "连云港";
/*     */   public static final String COMPANY_YANGZHOU = "扬州";
/*     */   public static final String COMPANY_ZHENJIANG = "镇江";
/*     */   public static final String COMPANY_TAIZHOU = "泰州";
/*     */   public static final String COMPANY_SUQIAN = "宿迁";
/*     */   public static final String COMPANY_YANCHENG = "盐城";
/*     */   public static final String COMPANY_GUANGDONG = "珠海,汕头,佛山,韶关,河源,梅州,惠州,汕尾,东莞,中山,江门,阳江,湛江,茂名,肇庆,清远,潮州,揭阳,云浮";
/*     */   public static final String COMPANY_NEWGUANGDONG = "广东,深圳,广州,珠海,汕头,佛山,韶关,河源,梅州,惠州,汕尾,东莞,中山,江门,阳江,湛江,茂名,肇庆,清远,潮州,揭阳,云浮";
/*     */   public static final String COMPANY_JIANGXI = "南昌,九江,景德镇,萍乡,新余,鹰潭,赣州,宜春,上饶,吉安,抚州,江西";
/*     */   public static final String COMPANY_HUNAN = "长沙,株洲,湘潭,衡阳,邵阳,岳阳,常德,张家界,益阳,郴州,永州,怀化,娄底,湘西,湖南";
/*     */   public static final String COMPANY_GUANGXI = "广西,南宁,桂林,北海,柳州,梧州,玉林,百色,崇左,贵港,河池,贺州,来宾,防城港,钦州";
/*     */   public static final String COMPANY_ANHUI = "安徽,合肥,淮北,亳州,宿州,蚌埠,阜阳,淮南,滁州,六安,马鞍山,芜湖,宣城,铜陵,池州,安庆,黄山";
/*     */   public static final String COMPANY_HENAN = "河南,郑州,开封,洛阳,平顶山,新乡,安阳,焦作,鹤壁,濮阳,三门峡,许昌,漯河,南阳,商丘,信阳,周口,驻马店,济源";
/*     */   public static final String COMPANY_ZHEJIANG = "浙江,宁波,金华,温州,台州,丽水,绍兴,衡州,舟山,嘉兴,湖州,温岭";
/*     */   public static final String COMPANY_HEBEI = "河北,石家庄,保定,唐山,邯郸,张家口,承德,邢台,秦皇岛,廊坊,沧州,衡水";
/*     */   public static final String COMPANY_JIANGSU = "江苏,淮安";
/* 120 */   protected String name = null;
/* 121 */   protected String captcha = null;
/*     */ 
/*     */   protected abstract Map<String, Object> getCompanyByWeb() throws CaptchaException;
/*     */ 
/*     */   public void setCaptcha(String captcha)
/*     */   {
/* 127 */     this.captcha = captcha;
/*     */   }
/*     */ 
/*     */   public Map<String, Object> getCompanyInfo(boolean refresh)
/*     */     throws CaptchaException
/*     */   {
/* 134 */     if (!refresh)
/*     */     {
/* 136 */       if ((this.captcha == null) || (this.captcha.trim().length() == 0)) {
/* 137 */         Map item = getDetailByDB(this.name);
/* 138 */         if ((item != null) && (item.size() > 0)) {
/* 139 */           return item;
/*     */         }
/*     */       }
/*     */     }
/* 143 */     return getCompanyByWeb();
/*     */   }
/*     */ 
/*     */   protected static boolean isValid(String name) {
/* 147 */     if ((name == null) || (name.trim().length() == 0)) {
/* 148 */       return false;
/*     */     }
/*     */ 
/* 151 */     if (name.trim().length() <= 6) {
/* 152 */       return false;
/*     */     }
/*     */ 
/* 155 */     if (name.contains("个体经营")) {
/* 156 */       return false;
/*     */     }
/*     */ 
/* 159 */     return true;
/*     */   }
/*     */ 
/*     */   public static boolean isShow(String name)
/*     */   {
/* 169 */     for (String area : "上海,北京,湖北,武汉,广东,深圳,广州,杭州,珠海,汕头,佛山,韶关,河源,梅州,惠州,汕尾,东莞,中山,江门,阳江,湛江,茂名,肇庆,清远,潮州,揭阳,云浮,南昌,九江,景德镇,萍乡,新余,鹰潭,赣州,宜春,上饶,吉安,抚州,江西,长沙,株洲,湘潭,衡阳,邵阳,岳阳,常德,张家界,益阳,郴州,永州,怀化,娄底,湘西,湖南,广西,南宁,桂林,北海,柳州,梧州,玉林,百色,崇左,贵港,河池,贺州,来宾,防城港,钦州,安徽,合肥,淮北,亳州,宿州,蚌埠,阜阳,淮南,滁州,六安,马鞍山,芜湖,宣城,铜陵,池州,安庆,黄山,河南,郑州,开封,洛阳,平顶山,新乡,安阳,焦作,鹤壁,濮阳,三门峡,许昌,漯河,南阳,商丘,信阳,周口,驻马店,济源,浙江,宁波,金华,温州,台州,丽水,绍兴,衡州,舟山,嘉兴,湖州,温岭,济南,河北,石家庄,保定,唐山,邯郸,张家口,承德,邢台,秦皇岛,廊坊,沧州,衡水,昆明,江苏,南京,无锡,徐州,常州,苏州,南通,连云港,淮安,盐城,扬州,镇江,泰州,宿迁".split(",")) {
/* 170 */       if (name.contains(area)) {
/* 171 */         return true;
/*     */       }
/*     */     }
/*     */ 
/* 175 */     return false;
/*     */   }
/*     */ 
/*     */   public static boolean needCaptcha(String name)
/*     */   {
/* 189 */     return false;
/*     */   }
/*     */ 
/*     */   public static SearchEngine getInstance(String name) {
/* 193 */     if (!isValid(name)) {
/* 194 */       return null;
/*     */     }
/* 196 */     SearchEngine searchEngine = null;
/* 197 */     if (name.contains("上海")) {
/* 198 */       searchEngine = new ShanghaiSearchEngine(name);
/* 199 */       return searchEngine;
/*     */     }
/*     */ 
/* 202 */     if (name.contains("北京")) {
/* 203 */       searchEngine = new BeijingSearchEngine(name);
/* 204 */       return searchEngine;
/*     */     }
/*     */ 
/* 207 */     if ((name.contains("湖北")) || (name.contains("武汉"))) {
/* 208 */       searchEngine = new WuhanSearchEngine(name);
/* 209 */       return searchEngine;
/*     */     }
/*     */ 
/* 217 */     if (name.contains("杭州")) {
/* 218 */       searchEngine = new HangzhouSearchEngine(name);
/* 219 */       return searchEngine;
/*     */     }
/*     */ 
/* 222 */     if (name.contains("济南")) {
/* 223 */       searchEngine = new JiNanSearchEngine(name);
/* 224 */       return searchEngine;
/*     */     }
/*     */ 
/* 227 */     if (name.contains("昆明")) {
/* 228 */       searchEngine = new KunmingSearchEngine(name);
/* 229 */       return searchEngine;
/*     */     }
/*     */ 
/* 233 */     if (name.contains("南通")) {
/* 234 */       searchEngine = new NantongSearchEngine(name);
/* 235 */       return searchEngine;
/*     */     }
/* 237 */     if (name.contains("南京")) {
/* 238 */       searchEngine = new NanjingSearchEngine(name);
/* 239 */       return searchEngine;
/*     */     }
/* 241 */     if (name.contains("无锡")) {
/* 242 */       searchEngine = new WuxiSearchEngine(name);
/* 243 */       return searchEngine;
/*     */     }
/* 245 */     if (name.contains("徐州")) {
/* 246 */       searchEngine = new XuzhouSearchEngine(name);
/* 247 */       return searchEngine;
/*     */     }
/* 249 */     if (name.contains("常州")) {
/* 250 */       searchEngine = new ChangzhouSearchEngine(name);
/* 251 */       return searchEngine;
/*     */     }
/* 253 */     if (name.contains("苏州")) {
/* 254 */       searchEngine = new SuzhouSearchEngine(name);
/* 255 */       return searchEngine;
/*     */     }
/* 257 */     if (name.contains("连云港")) {
/* 258 */       searchEngine = new LianyungangSearchEngine(name);
/* 259 */       return searchEngine;
/*     */     }
/* 261 */     if (name.contains("扬州")) {
/* 262 */       searchEngine = new YangzhouSearchEngine(name);
/* 263 */       return searchEngine;
/*     */     }
/* 265 */     if (name.contains("镇江")) {
/* 266 */       searchEngine = new ZhenjiangSearchEngine(name);
/* 267 */       return searchEngine;
/*     */     }
/* 269 */     if (name.contains("泰州")) {
/* 270 */       searchEngine = new TaizhouSearchEngine(name);
/* 271 */       return searchEngine;
/*     */     }
/* 273 */     if (name.contains("宿迁")) {
/* 274 */       searchEngine = new SuqianSearchEngine(name);
/* 275 */       return searchEngine;
/*     */     }
/* 277 */     if (name.contains("盐城")) {
/* 278 */       searchEngine = new YanchengSearchEngine(name);
/* 279 */       return searchEngine;
/*     */     }
/*     */ 
/* 291 */     if (isArea("广东,深圳,广州,珠海,汕头,佛山,韶关,河源,梅州,惠州,汕尾,东莞,中山,江门,阳江,湛江,茂名,肇庆,清远,潮州,揭阳,云浮", name)) {
/* 292 */       searchEngine = new NewGuangdongSearchEngine(name);
/* 293 */       return searchEngine;
/*     */     }
/*     */ 
/* 296 */     if (isArea("南昌,九江,景德镇,萍乡,新余,鹰潭,赣州,宜春,上饶,吉安,抚州,江西", name)) {
/* 297 */       searchEngine = new JiangxiSearchEngine(name);
/* 298 */       return searchEngine;
/*     */     }
/*     */ 
/* 301 */     if (isArea("长沙,株洲,湘潭,衡阳,邵阳,岳阳,常德,张家界,益阳,郴州,永州,怀化,娄底,湘西,湖南", name)) {
/* 302 */       searchEngine = new HunanSearchEngine(name);
/* 303 */       return searchEngine;
/*     */     }
/*     */ 
/* 306 */     if (isArea("广西,南宁,桂林,北海,柳州,梧州,玉林,百色,崇左,贵港,河池,贺州,来宾,防城港,钦州", name)) {
/* 307 */       searchEngine = new GuangxiSearchEngine(name);
/* 308 */       return searchEngine;
/*     */     }
/*     */ 
/* 311 */     if (isArea("安徽,合肥,淮北,亳州,宿州,蚌埠,阜阳,淮南,滁州,六安,马鞍山,芜湖,宣城,铜陵,池州,安庆,黄山", name)) {
/* 312 */       searchEngine = new AnhuiSearchEngine(name);
/* 313 */       return searchEngine;
/*     */     }
/*     */ 
/* 316 */     if (isArea("河南,郑州,开封,洛阳,平顶山,新乡,安阳,焦作,鹤壁,濮阳,三门峡,许昌,漯河,南阳,商丘,信阳,周口,驻马店,济源", name)) {
/* 317 */       searchEngine = new HenanSearchEngine(name);
/* 318 */       return searchEngine;
/*     */     }
/*     */ 
/* 321 */     if (isArea("浙江,宁波,金华,温州,台州,丽水,绍兴,衡州,舟山,嘉兴,湖州,温岭", name)) {
/* 322 */       searchEngine = new ZhejiangSearchEngine(name);
/* 323 */       return searchEngine;
/*     */     }
/*     */ 
/* 326 */     if (isArea("河北,石家庄,保定,唐山,邯郸,张家口,承德,邢台,秦皇岛,廊坊,沧州,衡水", name)) {
/* 327 */       searchEngine = new HebeiSearchEngine(name);
/* 328 */       return searchEngine;
/*     */     }
/*     */ 
/* 331 */     if (isArea("江苏,淮安", name)) {
/* 332 */       searchEngine = new JiangsuSearchEngine(name);
/* 333 */       return searchEngine;
/*     */     }
/* 335 */     return null;
/*     */   }
/*     */ 
/*     */   private static boolean isArea(String province, String name) {
/* 339 */     for (String area : province.split(",")) {
/* 340 */       if (name.contains(area)) {
/* 341 */         return true;
/*     */       }
/*     */     }
/* 344 */     return false;
/*     */   }
/*     */ 
/*     */   public static String standardizedName(String name) {
/* 348 */     if ((name == null) || (name.trim().length() == 0)) {
/* 349 */       return name;
/*     */     }
/*     */ 
/* 352 */     name = name.trim();
/* 353 */     name = name.replace("(", "（");
/* 354 */     name = name.replace(")", "）");
/*     */ 
/* 356 */     return name;
/*     */   }
/*     */ 
/*     */   protected Map<String, Object> getDetailByDB(String companyName) {
/* 360 */     CompanyBusinessArchiveManager manager = new CompanyBusinessArchiveManager();
/* 361 */     return manager.getDetail(companyName);
/*     */   }
/*     */ 
/*     */   protected int saveDB(Map<String, Object> companyInfo) {
/* 365 */     CompanyBusinessArchiveManager manager = new CompanyBusinessArchiveManager();
/* 366 */     return manager.add(companyInfo);
/*     */   }
/*     */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.businessarchives.SearchEngine
 * JD-Core Version:    0.6.1
 */